import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Layout from '@/components/layout/layout'
import Login from '@/components/common/login'
import Preview from '@/views/preview/myPreview'
import ProductList from '@/views/product/productList'
import ProductEdit from '@/views/product/productEdit'
import ProductType from '@/views/product/productType'
import User from '@/views/sys/user/user'
import Role from '@/views/sys/role/role'
import Menu from '@/views/sys/menu/menu'
import InventoryDetails from '@/views/inventory/inventoryDetails'
import InventoryFlowing from '@/views/inventory/inventoryFlowing'
import InventoryPut from '@/views/inventory/inventoryPut'
import InventoryOut from '@/views/inventory/inventoryOut'
import Order from '@/views/order/order'
import Money from '@/views/money/money'

Vue.use(Router);

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/money',
      name: 'Money',
      component: Money
    },
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      children: [
        {
          path: '/preview',
          name: 'Preview',
          component: Preview
        },
        {
          path: '/product',
          name: 'ProductList',
          component: ProductList
        },
        {
          path: '/product/edit',
          name: 'ProductEdit',
          component: ProductEdit
        },
        {
          path: '/product/type',
          name: 'ProductType',
          component: ProductType
        },
        {
          path: '/inventory/details',
          name: 'InventoryDetails',
          component: InventoryDetails
        },
        {
          path: '/inventory/flowing',
          name: 'InventoryFlowing',
          component: InventoryFlowing
        },
        {
          path: '/inventory/put',
          name: 'InventoryPut',
          component: InventoryPut
        },
        {
          path: '/inventory/out',
          name: 'InventoryOut',
          component: InventoryOut
        },
        {
          path: '/order',
          name: 'Order',
          component: Order
        },
        {
          path: '/user',
          name: 'User',
          component: User
        },
        {
          path: '/role',
          name: 'Role',
          component: Role
        },
        {
          path: '/menu',
          name: 'Menu',
          component: Menu
        }
      ]
    }
  ]
})
